package robot;
import lejos.nxt.Battery;
public class BatteryEx{ 

	Battery battery;
	//full battery ~9000mV
	double fullbattery = 9000;
	
	public int getBatteryLevelPercentage(){
		int level = Battery.getVoltageMilliVolt();
		double currentlevel = level;
		double dpercentage = (currentlevel/fullbattery)*100;
		int percentage = (int) dpercentage;
		return percentage;
	}
	
}
